$(document).ready(function(){

	var pages = document.body.getAttribute("page");
	
	var page = pages.split(".");
	var current_page = SEPRO.pages;
	for(var i=0; i<page.length; i++){
		current_page = current_page[page[i]];
	}
	current_page.init();
});

var SEPRO = {};
SEPRO.pages = {};

SEPRO.pages.index = {


	init: function(){
		this.add_event_to_picture_slide();	
		this.add_event_to_tabs();
	},
	
	add_event_to_tabs: function(){
		$(".main-center-middle-tabs").tabs();	
	},
	
	add_event_to_picture_slide: function(){
		var aEls = $(".slide-photos-container a");
		this.slide_picture_count = aEls.size();
		this.slide_picture_seq = 0;
		$("body").everyTime("6s", SEPRO.pages.index.switch_slide_pictures);
	},
	
	slide_picture_seq: 0,
	slide_picture_count: 0,
	switch_slide_pictures: function(){
		var aEls = $(".slide-photos-container a").eq(SEPRO.pages.index.slide_picture_seq);
		var divEls = $(".slide-photos-container .picture-slide-bar").eq(SEPRO.pages.index.slide_picture_seq);
		aEls.hide();
		divEls.hide();
		
		SEPRO.pages.index.slide_picture_seq = (SEPRO.pages.index.slide_picture_seq + 1) % SEPRO.pages.index.slide_picture_count;
		aEls = $(".slide-photos-container a").eq(SEPRO.pages.index.slide_picture_seq);
		divEls = $(".slide-photos-container .picture-slide-bar").eq(SEPRO.pages.index.slide_picture_seq);
		aEls.show();
		divEls.show();
	}
}